package com.yuntuzhilian.chapter6;

/**
 * @author MrWang-shuizhishuiheshui
 * @description 父类宠物类
 */
public abstract class Pet {
    //将共同的属性放到父类中
    private String name;
    private int health;
    private int love;
    //构造
    public Pet() {
    }
    public Pet(String name, int health, int love) {
        this.name = name;
        this.health = health;
        this.love = love;
    }

    //将共同的方法放到父类中
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getHealth() {
        return health;
    }
    public void setHealth(int health) {
        this.health = health;
    }
    public int getLove() {
        return love;
    }
    public void setLove(int love) {
        this.love = love;
    }

    public abstract void show();


    public abstract void eat();

}
